home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / networking / amitcp / amislate1.0.lha / AmiSlate1.0 / SlateRexx / flower.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1995-03-13  |  1011 b   |  45 lines

  1. /* An Arexx script for use with AmiSlate:  
  2.  
  3.    Draws a pretty multicolored flowery pattern on the AmiSlate window
  4. */
  5. parse arg CommandPort ActiveString
  6.  
  7. address (CommandPort)
  8. options results
  9.  
  10. x=15
  11. y=15
  12. dx=0
  13. dy=0
  14. nsteps = 1000
  15. nscale = 16/1000
  16.  
  17.  
  18. penreset
  19.  
  20. /* Draw a black box around the window border */
  21. setfcolor 0 0 0
  22. GetWindowAttrs stem win.
  23.  
  24. /* Note that GetWindowAttrs returns the size of the whole window including
  25.    the ToolBar, Palette, Chat Lines, Title, and everything else.  To just
  26.    draw to the border of the drawing area, we need to subtract the constants
  27.    below.  */
  28. square 0 0 (win.width - 58) (win.height - 53)
  29.  
  30. /* Calculate center of drawing area */
  31. mx = trunc((win.width-58)/2)
  32. my = trunc((win.height-53)/2)
  33.  
  34. do while (1)
  35.     pen x y
  36.     if (x < mx) then dx = dx + 1
  37.     if (x > mx) then dx = dx - 1
  38.     if (y < my) then dy = dy + 1
  39.     if (y > my) then dy = dy - 1
  40.  
  41.     x = x + dx
  42.     y = y + dy
  43.     xx = delay(1)
  44.     setfcolor trunc(random()*nscale) trunc(random()*nscale) trunc(random()*nscale) notbackground
  45. end